To identify and exploit insecure access controls within a simulated PHP web application that includes both authenticated and admin-only functionality, some of which is improperly protected.
The application provides a login interface with two test accounts:
admin / adminpasslowpriv / userpassThe interface hinted at different permissions depending on the logged-in user’s role.
Logged in as each user to confirm access levels:
The backend logic used a session-stored role to restrict access via conditionals in a switch statement. Example:
if ($role !== 'admin') {
echo "<h3>Access Denied</h3>";
break;
}
Two critical admin endpoints did not include any role validation:
case 'export_data':
// Normally admin-only, but missing role check
case 'shutdown_system':
// Normally admin-only, but missing role check
While logged in as lowpriv, manually accessing:
?ajax=1&action=export_data?ajax=1&action=shutdown_systemSuccessfully triggered the admin functionality without proper authorization.
This lab highlighted the impact of broken access control mechanisms. Sensitive functionality like data export and system shutdown was accessible to low-privilege users due to missing server-side role validation. It’s a strong reminder of the importance of secure coding practices and consistent access enforcement.